﻿using IndustrialCommunication.Core.Interface;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace IndustrialCommunication.Core.Channel
{
    public abstract class ChannelBase<TPackageInfo> : IChannel<TPackageInfo>
    {
        public bool IsClosed { get; private set; }
        public DateTimeOffset LastActiveTime { get; private set; }
        public abstract void Close();
        public abstract Task CloseAsync();
        public abstract void Send(byte[] data);
        public abstract Task SendAsync(TPackageInfo package, IPackageEncoder<TPackageInfo> encoder);
        public abstract Task SendSync(byte[] data);
     
    }
}
